import 'package:flutter/cupertino.dart';
import 'package:get/get.dart';
import 'package:xiaomishop/app/modules/category/views/category_view.dart';
import 'package:xiaomishop/app/modules/main/views/main_view.dart';
import 'package:xiaomishop/app/modules/service/views/service_view.dart';
import 'package:xiaomishop/app/modules/shopcar/views/shopcar_view.dart';
import 'package:xiaomishop/app/modules/user/views/user_view.dart';

class HomeController extends GetxController {
  final List<Widget> pageViews = const [
    MainView(),
    CategoryView(),
    ServiceView(),
    ShopcarView(),
    UserView()
  ];

  //pageview控制器，默认第0个选中
  PageController pageController = PageController(initialPage: 0);

  @override
  void onInit() {
    super.onInit();
  }

  @override
  void onReady() {
    super.onReady();
  }

  @override
  void onClose() {
    super.onClose();
  }

  RxInt currentIndex = 0.obs;

  void setCurrentIndex(index) {
    currentIndex.value = index;
    update();
  }
}
